package contactbook;

import contactbook.dao.AccountDAOInterface;
import contactbook.model.Account;
import contactbook.service.AccountServiceInterface;
import contactbook.service.ServiceLocator;

public class AccountClient implements AccountServiceInterface {
	
	private AccountServiceInterface accountService;
	
	public AccountClient() {
		ServiceLocator sl = ServiceLocator.getInstance();
		accountService = sl.getAccountService();
	}
	
	@Override
	public Account login(String login, String password) {
		return accountService.login(login, password);
	}
	
	@Override
	public void logout() {
		accountService.logout();
	}
	
	@Override
	public Account create(Account account) {
		return accountService.create(account);
	}
	
	@Override
	public void delete() {
		accountService.delete();
	}

	@Override
	public Account getAccountById(int accountId) {
		return accountService.getAccountById(accountId);
	}

	@Override
	public boolean isLogged() {
		return accountService.isLogged();
	}

	@Override
	public void setDAO(AccountDAOInterface dao) {
		accountService.setDAO(dao);
	}

	@Override
	public void update(Account account) {
		accountService.update(account);
	}
}
